fix: Add dark mode support (#42)#3
Open
aidandaly24 wants to merge 7 commits intomainfrom
Open
Conversation
- Add light and dark theme color palettes - Add system preference detection for automatic theme selection - Support AGENTCORE_THEME environment variable for manual override - Maintain backward compatibility with existing color exports
- Create ThemeContext to manage theme state - Add useTheme hook for accessing theme colors - Add ThemeProvider component for wrapping the app - Support system detection and manual theme override
- Add ThemeProvider and useTheme exports
- Wrap app with ThemeProvider for dark mode support - Theme is automatically detected from system preferences - Can be overridden via AGENTCORE_THEME environment variable
- Test getThemeColors for light and dark modes - Test getThemeMode with environment variable - Test detectSystemTheme with various indicators - Test theme color palette completeness
- Test useTheme hook returns correct theme colors - Test ThemeProvider with different initial modes - Test system detection flag - Test environment variable override
- Document AGENTCORE_THEME environment variable - Explain system detection behavior - Add examples for light, dark, and system modes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds dark mode support to the CLI dashboard. The colors are now configurable and respect system preferences.
Changes
New Features
COLORFGBG,APPLE_INTERFACE_STYLE,TERMINAL_LIGHT_MODE)AGENTCORE_THEMEenvironment variable (light,dark, orsystem)ThemeProvideranduseThemehook for components to access theme colorsFiles Changed
src/cli/tui/theme.ts- Expanded with light/dark theme palettes and detection logicsrc/cli/tui/context/ThemeContext.tsx- New React context for theme managementsrc/cli/tui/context/index.ts- Export new theme contextsrc/cli/tui/App.tsx- Wrapped app withThemeProviderdocs/configuration.md- Added documentation for theme configurationTests Added
src/cli/tui/__tests__/theme.test.ts- Unit tests for theme functionssrc/cli/tui/context/__tests__/ThemeContext.test.tsx- Unit tests for ThemeContextUsage
Backward Compatibility
The existing
STATUS_COLORS,INTERACTIVE_COLORS,TEXT_COLORS, andTHEMEexports are maintained for backward compatibility. They now dynamically return colors based on the current theme mode. These are marked as deprecated in favor of the newuseTheme()hook.Testing
Closes aws#42